﻿<%@ Page Title="Office Avail Fares" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="OfficeAvailFares.aspx.cs" Inherits="IFD2.OfficeAvailFares" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script src="js/city_suggestion.min.js"></script>

    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <%--<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>--%>
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="LabelAirline" runat="server" Text="Airline:" meta:resourcekey="Airline"></asp:Label>
                <asp:DropDownList ID="lstAirline2" runat="server" CssClass="form-control input-sm" Width="100%" DataSourceID="sqlAirlines" DataTextField="name" DataValueField="code">
                </asp:DropDownList>
            </div>
            <div class="form-group">
                <asp:Label ID="Label1" runat="server" Text="Trip:" meta:resourcekey="Trip"></asp:Label>
                <asp:TextBox ID="txtOri" runat="server" CssClass="form-control input-sm" Width="100%" MaxLength="4"></asp:TextBox>
                -<br />
                <asp:TextBox ID="txtDes" runat="server" CssClass="form-control input-sm" Width="100%" MaxLength="4"></asp:TextBox>
            </div>
            <div class="form-group">
                <asp:Label ID="Label2" runat="server" Text="Date:" meta:resourcekey="Date"></asp:Label>
                <asp:TextBox ID="txtFltdate" runat="server" CssClass="form-control input-sm" Width="100%" MaxLength="15" ></asp:TextBox>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
            <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>
            
            <div id="targetDiv" style="position:absolute;border:solid 1px black; z-index:20000; background-color:White; display:none;"></div>

            <asp:HiddenField ID="hidIpaddr" runat="server" />
            <asp:SqlDataSource ID="sqlAirlines" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                SelectCommand="bll_airline_get_names_by_lang" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                <SelectParameters>
                    <asp:SessionParameter Name="lang" SessionField="LANG" Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" 
                            DataSourceID="SqlDataSource2" style="min-width:1200px;width:100%;" class="table-hover">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White"/>
                            <RowStyle BackColor="#EFF3FB" />
                            <EditRowStyle BackColor="#2461BF" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateField SortExpression="bk_id">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl='<%# "QueryFareStairs.aspx?airline="+Eval("airline")+"&fare_code="+Eval("code")+"&seg_sn="+Eval("seg_sn") %>'>
                                            <span class="glyphicon glyphicon-signal" style="font-size:large;"></span>
                                        </asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="airline" HeaderText="airline" SortExpression="airline"  meta:resourcekey="airline1" Visible="False"/>
                                <asp:BoundField DataField="code" HeaderText="code" SortExpression="code"  meta:resourcekey="code" />
                                <asp:TemplateField HeaderText="Seg." meta:resourcekey="Seg">
                                    <ItemTemplate>
                                    <%# Eval("seg_sn")+"/"+Eval("seg_total") %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="ori_airport" HeaderText="ori_airport" SortExpression="ori_airport"  meta:resourcekey="ori1"/>
                                <asp:BoundField DataField="des_airport" HeaderText="des_airport" SortExpression="des_airport"  meta:resourcekey="des1"/>
                                <asp:BoundField DataField="cabin" HeaderText="cabin" SortExpression="cabin"  meta:resourcekey="cabin" />
                                <asp:BoundField DataField="class" HeaderText="class" SortExpression="class"  meta:resourcekey="class" />
                                <asp:BoundField DataField="seats_min" HeaderText="seats_min" SortExpression="seats_min"  meta:resourcekey="seats_min" />
                                <asp:BoundField DataField="week_mask" HeaderText="week_mask" SortExpression="week_mask"  meta:resourcekey="week_mask" />
                                <asp:BoundField DataField="stay_min" HeaderText="stay_min" SortExpression="stay_min"  meta:resourcekey="stay_min" />
                                <asp:BoundField DataField="stay_max" HeaderText="stay_max" SortExpression="stay_max"  meta:resourcekey="stay_max" />
                                <asp:BoundField DataField="open_advance" HeaderText="open_advance" SortExpression="open_advance"  meta:resourcekey="open_advance" />
                                <asp:BoundField DataField="close_advance" HeaderText="close_advance" SortExpression="close_advance"  meta:resourcekey="close_advance" />
                                <asp:BoundField DataField="currency" HeaderText="currency" SortExpression="currency"  meta:resourcekey="currency" />
                                <asp:BoundField DataField="adt_price" HeaderText="price" SortExpression="price"  meta:resourcekey="price" />
                                <asp:BoundField DataField="chd_price" HeaderText="chd_price" SortExpression="chd_price"  meta:resourcekey="chd_price" />
                                <asp:BoundField DataField="inf_price" HeaderText="inf_price" SortExpression="inf_price"  meta:resourcekey="inf_price" />
                                <asp:BoundField DataField="agent_rate" HeaderText="agent_rate" SortExpression="agent_rate"  meta:resourcekey="agent_rate" />
                                <asp:BoundField DataField="agent_policy" HeaderText="agent_policy" SortExpression="agent_policy"  meta:resourcekey="agent_policy" />
                            </Columns>
                        </asp:GridView>

                        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" SelectCommand="bll_office_query_avail_fares" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lstAirline2" Name="airline" PropertyName="SelectedValue" Type="String" />
                                <asp:ControlParameter ControlID="txtOri" Name="ori" PropertyName="Text" Type="String" />
                                <asp:ControlParameter ControlID="txtDes" Name="des" PropertyName="Text" Type="String" />
                                <asp:ControlParameter ControlID="txtFltdate" Name="flt_date" PropertyName="Text" Type="DateTime" />
                                <asp:SessionParameter Name="office" SessionField="OFFICE" Type="String" />
                                <asp:SessionParameter Name="user_airline" SessionField="AIRLINE" Type="String" />
                                <asp:SessionParameter Name="user" SessionField="USER" Type="String" />
                                <asp:ControlParameter ControlID="hidIpaddr" Name="ip_addr" PropertyName="Value" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </div>

                </div>
            </div>
        </div>
    </div>

    </div>
    <%--</ContentTemplate></asp:UpdatePanel>--%>
    </form>

    <script src="JS/ScrollableGridPlugin.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var win_height = parseInt($(window).height());
            var tab_new_height= win_height-50-100;//菜单占50， 为便于操作留空100
            if ($('#<%=GridView1.ClientID %>').height()>tab_new_height)
                $('#<%=GridView1.ClientID %>').Scrollable({ ScrollHeight: tab_new_height });
        });
    </script>

</asp:Content>
